@import '../_mixins.scss';
@import '../_vars.scss';

@mixin hidden-transform($placement) {
  @if ($placement == 'top') {
    transform: translateY(-20px);
  } @else if ($placement == 'bottom') {
    transform: translateY(20px);
  } @else if ($placement == 'left') {
    transform: translateX(-20px);
  } @else if ($placement == 'right') {
    transform: translateX(20px);
  }
}

.#{$namespace-prefix}-box {
  &[data-animation='shift-toward-extreme'][data-state='hidden'] {
    opacity: 0;

    @each $placement in $placements {
      &[data-placement^='#{$placement}'] {
        @include hidden-transform($placement);
      }
    }
  }
}
